---
layout: example
categories: example/v1.0.0
version: v1.0.0
title: Leaflet Locate
description: Add a find me control that sets the map view to the current coordinates a user is in the world.
tags:
  - plugins
---
<script src='{{site.tileApi}}/mapbox.js/plugins/leaflet-locatecontrol/v0.43.0/L.Control.Locate.min.js'></script>
<link href='{{site.tileApi}}/mapbox.js/plugins/leaflet-locatecontrol/v0.43.0/L.Control.Locate.mapbox.css' rel='stylesheet' />
<!--[if lt IE 9]>
<link href='{{site.tileApi}}/mapbox.js/plugins/leaflet-locatecontrol/v0.43.0/L.Control.Locate.ie.css' rel='stylesheet' />
<![endif]-->
<link href='{{site.tileApi}}/mapbox.js/plugins/leaflet-locatecontrol/v0.43.0/css/font-awesome.min.css' rel='stylesheet' />

<div id='map'></div>
<script>
    var map = L.mapbox.map('map')
      .setView([0, 0], 4)
      .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));

    L.control.locate().addTo(map);
</script>
